package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NewForDemo {
    public static void main(String[] args) {
        String [] a={"one","two","three","four","five"};
        for (int i = 0; i <a.length ; i++) {
            System.out.println(a[i]);
        }
        Collection c=new ArrayList();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");
        Iterator it=c.iterator();
        while(it.hasNext()){
            String str=(String)it.next();
        }
        System.out.println(c);




        for (String stwwr : a){
            System.out.println(stwwr);
        }

        for (Object dw:c){
            String str=(String)dw;
            System.out.println(str);
        }

    }
}
